Skip to content

Instantly share code, notes, and snippets.

from tinydb import TinyDB
# Disk storage
db = TinyDB('data.json')
# Memory storage
from tinydb.storages import MemoryStorage, Storage
db = TinyDB(storage=MemoryStorage)
@jesstess
jesstess / ELF_strings
Created February 18, 2012 21:36
Where in an ELF executable do various types of strings live?
Where in an ELF executable do various types of strings live?
Inspired by "How to waste a lot of space without knowing": http://glandium.org/blog/?p=2361
Test file:
$ cat /tmp/test.c
char *ptr_global = "ptr_global_string";
char array_global[] = "array_global_string";
@tomkail
tomkail / ExtendedScriptableObjectDrawer.cs
Last active May 16, 2024 01:54
Displays the fields of a ScriptableObject in the inspector
// Developed by Tom Kail at Inkle
// Released under the MIT Licence as held at https://opensource.org/licenses/MIT
// Must be placed within a folder named "Editor"
using System;
using System.Reflection;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
@anuragkapur
anuragkapur / fastly-latency-testing.sh
Last active May 16, 2024 01:52
Fastly latency compared to AWS API gateway
################
# Test script
################
#!/bin/bash
echo "fastlyTime,awsGatewayTime" >> responsetimes.log
while true
do
fastlyTime=`curl -o /dev/null -s -w %{time_total} -H 'X-Api-Key: 8Glz7vn2pM47AzzKmrXDU82h3S0Iud9n7wDgp3wM' https://round-trippa.ft.com/callback`
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 16, 2024 01:52
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@mjbalcueva
mjbalcueva / calendar.tsx
Last active May 16, 2024 01:49
shadcn ui calendar custom year and month dropdown
"use client"
import * as React from "react"
import { buttonVariants } from "@/components/ui/button"
import { ScrollArea } from "@/components/ui/scroll-area"
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"
import { cn } from "@/lib/utils"
import { ChevronLeft, ChevronRight } from "lucide-react"
import { DayPicker, DropdownProps } from "react-day-picker"
@jinjier
jinjier / 250.csv
Last active May 16, 2024 01:47
JavDB Top 250 movies code list. [Updated at 2024/02]
1 LAFBD-41
2 SSNI-497
3 ABP-984
4 IPX-580
5 IPX-811
6 IPX-177
7 STARS-804
8 SMBD-115
9 ABP-968
10 ABF-017
@tykurtz
tykurtz / grokking_to_leetcode.md
Last active May 16, 2024 01:46
Grokking the coding interview equivalent leetcode problems

GROKKING NOTES

I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window

@kborling
kborling / configuration.nix
Created December 24, 2021 23:59
NixOS Configuration (Sway/Wayland Enabled)
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
nix = {
package = pkgs.nixUnstable;
extraOptions = ''
@Aschen
Aschen / tutorial_softether_client.md
Last active May 16, 2024 01:44
Tutorial SoftEther Client (Ubuntu)

SoftEther Client

Download and install

Go to http://www.softether-download.com/files/softether and download SoftEther Client for the right architecture.

> cd /tmp
> wget http://www.softether-download.com/files/softether/v4.18-9570-rtm-2015.07.26-tree/Linux/SoftEther_VPN_Client/64bit_-_Intel_x64_or_AMD64/softether-vpnclient-v4.18-9570-rtm-2015.07.26-linux-x64-64bit.tar.gz
> tar xf softether-vpnclient-v4.18-9570-rtm-2015.07.26-linux-x64-64bit.tar.gz